package g;

import c.b.a.a.a;
import java.io.IOException;

/* compiled from: AsyncTimeout */
public class b implements z {
    public final /* synthetic */ z a;
    public final /* synthetic */ c b;

    public b(c cVar, z zVar) {
        this.b = cVar;
        this.a = zVar;
    }

    public a0 B() {
        return this.b;
    }

    public long c(e eVar, long j) throws IOException {
        this.b.i();
        try {
            long c = this.a.c(eVar, j);
            this.b.j(true);
            return c;
        } catch (IOException e) {
            IOException e2 = e;
            c cVar = this.b;
            if (cVar.k()) {
                e2 = cVar.l(e2);
            }
            throw e2;
        } catch (Throwable th) {
            this.b.j(false);
        }
    }

    public void close() throws IOException {
        this.b.i();
        try {
            this.a.close();
            this.b.j(true);
        } catch (IOException e) {
            IOException e2 = e;
            c cVar = this.b;
            if (cVar.k()) {
                e2 = cVar.l(e2);
            }
            throw e2;
        } catch (Throwable th) {
            this.b.j(false);
        }
    }

    public String toString() {
        StringBuilder g = a.g("AsyncTimeout.source(");
        g.append(this.a);
        g.append(")");
        return g.toString();
    }
}
